;Place a Plan North Symbol in the drawing at any orientation. (uses UPOINT)
;Also uses NA1.DWG (static horizontal part) and NA2.DWG (pointer, set to 
;any rotation)
;
;	AUTHOR: HENRY C. FRANCIS
;		425 N. ASHE ST.
;		SOUTHERN PINES, NC 28387
;		All rights reserved without prejudice.
;
;	Copyright:	5-27-94
;	Edited:		6-18-94
;
(DEFUN C:PLN ( / );pt1 pt2 pt3 inss1 inss2 e1ang e2ang
  (setvar "cmdecho" 0)
  (if dimscl nil (load"dimscl"))
  (dimscl)
  (if gvpno nil (load "gvpno"))
  (gvpno)
  (if c:mklayr nil (load"mklayr"))
  (c:svlayr)
  (setq pt1 (getpoint "\nCenter of North Arrow")
        mjrg "G"
        llt "-"
        colr "1"
        colra nil
        modf "SYMB"
  )
  (c:mklayr)
  (if (/=(getvar"viewtwist")0)
    (setq e1ang 0
          e2ang (- 0(*(/(getvar"viewtwist")pi)180))
    )
    (setq pt3
            (if
              (setq rotent(entsel "\nSelect rotated entity to match or Enter to Pick rotation. "))
              (polar pt1 (+(/ pi 2)(cdr(assoc 50(entget(car rotent)))))1)
              (upoint 1 "" "\nMagnetic North Direction " nil pt1)
            )
          e1ang (*(/(-(angle pt1 pt3)(/ pi 2.0))(* 2.0 pi))360.00)
          e2ang 0
    );setq
  )
  (setq pt1 (list(car pt1)(cadr pt1)(* dimsc 1001))
	pt2 (list(car pt1)(cadr pt1)(* dimsc 1010))
  )
;  (command)
  (command ".insert" "na2" pt1 dimsc dimsc e1ang
           ".insert" "na1" pt2 dimsc dimsc e2ang
  );command
  (c:rslayr)
  (setvar "cmdecho" 1)
;  (command)
  (princ)
);defun c:pln
